package com.itheima.service.impl;

import com.itheima.dao.CustomerDao;
import com.itheima.domain.Customer;
import com.itheima.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @version 1.0
 * @Author : wusiqi
 * @Date : 2019/3/7 20:48
 */

@Service
@Transactional
public class CustomerServiceImpl implements CustomerService {
    //自动注入 dao
    @Autowired
    private CustomerDao customerDao;
    @Override
    //查询全部 调用dao
    public List<Customer> findAll() {
        return customerDao.findAll();
    }

    //根据id 查找信息 返回更改页面
    @Override
    public Customer findById(String custId) {
        return customerDao.findById(custId);
    }

    //更改 页面数据
    @Override
    public void update(Customer customer) {
        customerDao.update(customer);
    }
}
